package o;

import android.content.Context;
import android.text.TextUtils;
import com.huawei.appgallery.assistantdock.gamemode.card.BuoyBaseEnterCard;
import com.huawei.appgallery.assistantdock.gamemode.card.BuoyLanternEnterCardBuoy;
import com.huawei.appgallery.assistantdock.gamemode.card.CallingDndEnterCardBuoy;
import com.huawei.appgallery.assistantdock.gamemode.card.DeepDndEnterCardBuoy;
import com.huawei.appgallery.assistantdock.gamemode.card.GameAccelerateEnterCardBuoy;
import com.huawei.appgallery.assistantdock.gamemode.card.GameDeviceEnterCardBuoy;
import com.huawei.appgallery.assistantdock.gamemode.card.GameKeepLuminanceCardBuoy;
import com.huawei.appgallery.assistantdock.gamemode.card.GestureEnterCardBuoy;
import com.huawei.appgallery.assistantdock.gamemode.card.KeyControlEnterCardBuoy;
import com.huawei.appgallery.assistantdock.gamemode.card.MsgDndEnterCardBuoy;
import com.huawei.appgallery.assistantdock.gamemode.card.NetOptimizationEnterCardBuoy;
import com.huawei.appgallery.assistantdock.gamemode.card.PowerModeEnterCardBuoy;
import com.huawei.appgallery.assistantdock.gamemode.card.ScreenRecordEnterCardBuoy;
import com.huawei.appgallery.assistantdock.gamemode.card.ScreenshotEnterCardBuoy;
import com.huawei.appgallery.assistantdock.gamemode.card.SoundToVibEnterCardBuoy;
import com.huawei.appgallery.assistantdock.gamemode.card.TripleFingerDisableEnterCardBuoy;
import com.huawei.appgallery.assistantdock.gamemode.card.VirtualKeyEnterCardBuoy;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import o.biu.a;

public class bid {
    private Context ॱ;

    public bid(Context context) {
        this.ॱ = context;
    }

    public BuoyBaseEnterCard ˊ(String str, boolean z, boolean z2, String str2) {
        if (TextUtils.isEmpty(str) || this.ॱ == null) {
            Logger.e("BuoyEnterCardDispatcher", "invalid key or context");
            return null;
        } else if (str.startsWith("free_form_clone|")) {
            return new bhs(this.ॱ, str.replace("free_form_clone|", ""), true);
        } else if (str.startsWith("free_form|")) {
            return new bhs(this.ॱ, str.replace("free_form|", ""), false);
        } else {
            BuoyBaseEnterCard gameDeviceEnterCardBuoy;
            boolean z3 = true;
            switch (str.hashCode()) {
                case -1677555522:
                    if (str.equals("keep_luminance")) {
                        z3 = true;
                        break;
                    }
                    break;
                case -911840637:
                    if (str.equals("all_app")) {
                        z3 = true;
                        break;
                    }
                    break;
                case -329704089:
                    if (str.equals("device_setting")) {
                        z3 = false;
                        break;
                    }
                    break;
                case -132232417:
                    if (str.equals("calling_dnd")) {
                        z3 = true;
                        break;
                    }
                    break;
                case 156612119:
                    if (str.equals("all_service")) {
                        z3 = true;
                        break;
                    }
                    break;
                case 1652017468:
                    if (str.equals("virtual_key_setting")) {
                        z3 = true;
                        break;
                    }
                    break;
                case 1911415123:
                    if (str.equals("buoy_record")) {
                        z3 = true;
                        break;
                    }
                    break;
            }
            switch (z3) {
                case false:
                    gameDeviceEnterCardBuoy = new GameDeviceEnterCardBuoy(this.ॱ);
                    break;
                case true:
                    gameDeviceEnterCardBuoy = new VirtualKeyEnterCardBuoy(this.ॱ);
                    break;
                case true:
                    gameDeviceEnterCardBuoy = new ScreenRecordEnterCardBuoy(this.ॱ);
                    break;
                case true:
                    gameDeviceEnterCardBuoy = new CallingDndEnterCardBuoy(this.ॱ);
                    break;
                case true:
                    gameDeviceEnterCardBuoy = new bhr(this.ॱ, HiAnalyticsConstant.BI_KEY_SERVICE, z2, z);
                    break;
                case true:
                    gameDeviceEnterCardBuoy = new bhr(this.ॱ, "app", z2, z);
                    break;
                case true:
                    gameDeviceEnterCardBuoy = new GameKeepLuminanceCardBuoy(this.ॱ);
                    break;
                default:
                    gameDeviceEnterCardBuoy = ॱ(this.ॱ, str);
                    break;
            }
            if (gameDeviceEnterCardBuoy == null) {
                return gameDeviceEnterCardBuoy;
            }
            gameDeviceEnterCardBuoy.ˎ(str2);
            return gameDeviceEnterCardBuoy;
        }
    }

    public BuoyBaseEnterCard ˊ(Object obj, boolean z, boolean z2, String str) {
        if (obj instanceof String) {
            return ˊ((String) obj, z, z2, str);
        }
        if (obj instanceof a) {
            a aVar = (a) obj;
            if ("all_app".equals(aVar.ˊ())) {
                return new bhr(this.ॱ, "app", z2, z);
            }
            if (big.ˎ(aVar.ॱ())) {
                if (!aVar.ʽ() || big.ˊ(aVar.ॱ())) {
                    return new bhs(this.ॱ, aVar);
                }
                return null;
            } else if (aVar.ʽ() || !big.ˎ("com.huawei.appmarket") || TextUtils.isEmpty(aVar.ˎ())) {
                return null;
            } else {
                return new bhs(this.ॱ, aVar);
            }
        }
        Logger.e("BuoyEnterCardDispatcher", "createEnterCard by object fail,key is invalid");
        return null;
    }

    private BuoyBaseEnterCard ॱ(Context context, String str) {
        Object obj = -1;
        switch (str.hashCode()) {
            case -2128226786:
                if (str.equals("game_power_save_mode")) {
                    obj = 7;
                    break;
                }
                break;
            case -2093156910:
                if (str.equals("game_key_control_mode")) {
                    obj = 2;
                    break;
                }
                break;
            case -1413758123:
                if (str.equals("game_dnd_mode")) {
                    obj = 1;
                    break;
                }
                break;
            case -1144206205:
                if (str.equals("game_gesture_disabled_mode")) {
                    obj = 4;
                    break;
                }
                break;
            case -43108627:
                if (str.equals("screen_shot")) {
                    obj = 3;
                    break;
                }
                break;
            case 740326773:
                if (str.equals("sound_to_vibrate_effect")) {
                    obj = 6;
                    break;
                }
                break;
            case 1201781981:
                if (str.equals("game_triple_finger")) {
                    obj = 5;
                    break;
                }
                break;
            case 1375632885:
                if (str.equals("net_optim")) {
                    obj = null;
                    break;
                }
                break;
        }
        switch (obj) {
            case null:
                return new NetOptimizationEnterCardBuoy(context);
            case 1:
                if (!bii.ॱ() || big.ˊ()) {
                    return new MsgDndEnterCardBuoy(context);
                }
                return new DeepDndEnterCardBuoy(context);
            case 2:
                return new KeyControlEnterCardBuoy(context);
            case 3:
                return new ScreenshotEnterCardBuoy(context);
            case 4:
                return new GestureEnterCardBuoy(context);
            case 5:
                return new TripleFingerDisableEnterCardBuoy(context);
            case 6:
                return new SoundToVibEnterCardBuoy(context);
            case 7:
                if (azc.ˎ().ॱ() <= 14) {
                    return new PowerModeEnterCardBuoy(context);
                }
                return new GameAccelerateEnterCardBuoy(context);
            default:
                return ˎ(context, str);
        }
    }

    private BuoyBaseEnterCard ˎ(Context context, String str) {
        Object obj = -1;
        switch (str.hashCode()) {
            case -1578952791:
                if (str.equals("lantern_campaign")) {
                    obj = 2;
                    break;
                }
                break;
            case 463975497:
                if (str.equals("lantern_gift")) {
                    obj = 1;
                    break;
                }
                break;
            case 978111542:
                if (str.equals("ranking")) {
                    obj = 3;
                    break;
                }
                break;
            case 1497605416:
                if (str.equals("lantern_forum")) {
                    obj = null;
                    break;
                }
                break;
            case 1747619631:
                if (str.equals("achievement")) {
                    obj = 4;
                    break;
                }
                break;
        }
        switch (obj) {
            case null:
            case 1:
            case 2:
            case 3:
            case 4:
                return new BuoyLanternEnterCardBuoy(context);
            default:
                return null;
        }
    }
}
